<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="_token" content="{{ csrf_token() }}"/>
    <title>宏邦客户解除绑定</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="{{asset('admin_assets/css/bootstrap.min.css')}}">
    <link rel="stylesheet" href="{{asset('admin_assets/css/font-awesome/css/font-awesome.min.css')}}">
    <link rel="stylesheet" href="{{asset('admin_assets/css/AdminLTE.min.css')}}">
    <style>
        #body {
            width: 100%;
            height: 100%;
            margin: 0 auto;
            overflow: hidden;
        }
        #head{
            margin-top: 5%;
            width: 100%;
            text-align: center;
        }
        #head-logo{
            width: 270px;
            height: 65px;
        }
        #header {
            margin-top: 15%;
            color: #3c3c3c;
            font-family: "微软雅黑 Light";
            width: 100%;
            height: 30px;
            text-align: center;
            font-size: 18px;
        }

        #content {
            width: 100%;
            height: 70%;
        }

        #content #content_head {
            width: 100%;
            text-align: center;
        }

        #content #content_head #head_img {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            margin-top:10%;
        }

        #content_hb_name {
            width: 100%;
            text-align: center;
            font-size: 18px;
            color: #383838;
            margin-top: 15%;
        }
        #content_unbind_btn {
            width: 100%;
            margin-top: 25%;
        }

        #unbind_btn {
            width: 80%;
            height: 40px;
            margin-left: 10%;
            border: none;
            border-radius: 30px;
            background: #009aff;
            color: white;
            outline: none;
        }

        #footer {
            width: 100%;
            height: 40px;
            bottom: 0;
            position: fixed;
            text-align: center;
        }
    </style>
</head>
<body>
<div id="body">
    <div id="head">
        <img id="head-logo" src="{{asset('admin_assets/img/ip_login_logo.png')}}">
    </div>
    <div id="header">
        {{$userInfo['name']}}
    </div>
    <div id="content">
        <div id="content_head">
            <img src="{{$userInfo['avatar']}}" id="head_img">
        </div>
        <div id="content_hb_name" data-account="{{$account_id}}">宏邦账号:{{$account}}</div>
        <div id="content_unbind_btn">
            <button id="unbind_btn">解除绑定</button>
        </div>
    </div>
    <div id="footer">
        Copyright &copy;
            @if(date("Y",time())=="2018")
             2018
            @else
             2018~{{date("Y",time())}}
            @endif

        <a href="http://www.hongbung.com" target="_blank">上海宏邦知识产权代理有限公司</a>
    </div>
</div>
</body>
<script src="{{asset('admin_assets/js/jquery.min.js')}}"></script>
<script src="{{asset('admin_assets/js/bootstrap.min.js')}}"></script>
<script>
    $("#unbind_btn").click(function () {
        var account_id=$("#content_hb_name").attr("data-account");
        var formData = new FormData();
        formData.append("account_id" , account_id);
        $.ajax({
            url:'{{route("WeChat.wechatService.doUnbind")}}',
            data: formData,
            processData : false,
            contentType : false ,
            type:'post',
            headers: {
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
            },
            success:function (data) {
                $returnData=JSON.parse(data);
                alert($returnData.message);
                if($returnData.code==0){
                    window.location.href="{{route("WeChat.wechatService.login")}}";
                }
            },
            error:function (XMLHttpRequest, textStatus, errorThrown) {

                alert("绑定信息失败");
                window.location.reload();
            }
        });
    });

</script>
</body>
</html>
